\chapter{Preface}
\label{ch:preface}
We may have all heard the saying ``use it or lose it''. We experience it when we
feel rusty in a foreign language or sports that we have not practised in a
while. Practice is important to maintain skills but it is also key when learning
new ones. This is a reason why many textbooks and courses feature exercises.
However, the solutions to the exercises feel often overly brief, or are
sometimes not available at all. Rather than an opportunity to practice the new
skills, the exercises then become a source of frustration and are ignored.

\hspace{2ex} This book contains a collection of exercises with \emph{detailed}
solutions. The level of detail is, hopefully, sufficient for the reader to
follow the solutions and understand the techniques used. The exercises, however,
are not a replacement of a textbook or course on machine learning. I assume that
the reader has already seen the relevant theory and concepts and would now like
to deepen their understanding through solving exercises.

\hspace{2ex} While coding and computer simulations are extremely important in
machine learning, the exercises in the book can (mostly) be solved with pen and
paper. The focus on pen-and-paper exercises reduced length and simplified the
presentation. Moreover, it allows the reader to strengthen their mathematical
skills. However, the exercises are ideally paired with computer exercises to
further deepen the understanding.

\hspace{2ex} The exercises collected here are mostly a union of exercises that I
developed for the courses ``Unsupervised Machine Learning'' at the University of
Helsinki and ``Probabilistic Modelling and Reasoning'' at the University of
Edinburgh. The exercises do not comprehensively cover all of machine learning
but focus strongly on unsupervised methods, inference and learning.

\hspace{2ex} I am grateful to my students for providing feedback and asking
questions. Both helped to improve the quality of the exercises and solutions. I
am further grateful to both universities for providing the research and teaching
environment.

\hspace{2ex} My hope is that the collection of exercises will grow with time. I
intend to add new exercises in the future and welcome contributions from the
community. Latex source code is available at
\url{https://github.com/michaelgutmann/ml-pen-and-paper-exercises}. Please use
GitHub's issues to report mistakes or typos, and please get in touch if you
would like to make larger contributions.

\begin{flushright}
  Michael Gutmann\\
  Edinburgh, June 2022\\
  \url{https://michaelgutmann.github.io}
\end{flushright}


